package org.example.springTest.listener;


import org.example.springTest.event.RandomEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class RandomEventListener {


    //注解表示 需要监听
    @EventListener
    public  void onRandomEvent(RandomEvent event)
    {
        System.out.println("RandomEventListener: " + event.getSource());
    }
}
